import React, { Component } from 'react'

export default class Child3 extends Component {
    constructor(props){
        super(props);
        this.state = {}
    }

  render() {
    let  list  = this.props.list;
    return (
      <div>
        <div className='tr'>
            <div className='td'>编号</div>
            <div className='td'>姓名</div>
            <div className='td'>年龄</div>
            <div className='td'>操作</div>
        </div>
        {list.map(item=>{
          return  ( <div className='tr' key={item.id}>
          <div className='td'>{item.id}</div>
          <div className='td'>{item.username}</div>
          <div className='td'>{item.userage}</div>
          <div className='td' onClick={()=>{
            this.props.onDelById(item.id);
          }}>删除</div>
      </div>)  
        })}
      </div>
    )
  }
}
